local function checkSpells(spells, saved)
	local temp = {}
	for i = 0, saved.length do
		temp[i] = true
	end
	for i = 0, spells.length do
		local found = false
		for j = 0, saved.length do
			if spells[i] == saved[j] then
				found = true
				temp[j] = nil
				break
			end
		end
		if not found then
			saved.insert(spells[i])
		end
	end
	for i = saved.length, 0, -1 do
		if temp[i] then
			saved.remove(i)
			temp[i] = nil
		end
	end
	temp = nil
end